/*
 * Copyright (C) 2012-2013 Matthias Zeimer and the miniframes project group.
 * All rights reserved. 
 * 
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.opensource.org/licenses/EPL-1.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.miniframes.minivalues;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * <p>
 * Test-suite of {@link ReflectionUtil}.
 * </p>
 * 
 * @author Matthias Zeimer
 * @version 1
 * @since 0.1, 19.01.2013
 */
public class ReflectionUtilTest {

    @Test
    public void test() {

        Class<?> arguementT = ReflectionUtil
                .getValueTypeArguement(SimpleInvoiceNumber.class);
        assertSame(SimpleInvoiceNumber.class, arguementT);

        Class<?> arguement2T = ReflectionUtil
                .getValueTypeArguement(InvoiceNumber.class);
        assertSame(InvoiceNumber.class, arguement2T);

        // Finds the relevant fields of the value-type:
        // Set<Field> fieldsOfSimpleInvoiceNumber = ReflectionUtil
        // .findRelevantFields(SimpleInvoiceNumber.class);

    }

    static final class SimpleInvoiceNumber extends
            DomainValue<SimpleInvoiceNumber> {

        private static final long serialVersionUID = -6759669509556531127L;

    }

    static abstract class AbstractNumber<T extends DomainValue<T>> extends
            DomainValue<T> {

        private static final long serialVersionUID = 845462303828770471L;

    }

    static abstract class InvalidAbstractNumber extends
            DomainValue<InvalidAbstractNumber> {

        private static final long serialVersionUID = -6489099181764590207L;

    }

    static final class InvalidNumber extends InvalidAbstractNumber {

        private static final long serialVersionUID = -6619060581213269475L;

    }

    static final class InvoiceNumber extends AbstractNumber<InvoiceNumber> {

        private static final long serialVersionUID = 3823759482772997689L;

    }

    static final class InternalSequenceNumber extends
            TechnicalValue<InternalSequenceNumber> {

        private static final long serialVersionUID = 4704474122621234242L;

    }
}
